#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int N, a, i, s = 1, c = 1, f = 1;
    int arr[50] = { 0 };
    scanf("%d", &N);
    for (i = 0; i < N; i++)
    {
        scanf("%d", &arr[i]);

        if (i >= 1) {
            if (arr[i - 1] < arr[i])
                s = 0;
            if (arr[i - 1] > arr[i])
            {
                c = 0;
            }
            if (arr[i - 1] == arr[i])
                f = 0;
        }
    }
    if (s + c + f == 2) {
        printf("sorted");
    }
    else
        printf("unsorted");
    return 0;
}
